﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Epam.PhotoGallery.Interfaces.DataTransferObjects;
using Epam.PhotoGallery.Interfaces.Providers;
using Epam.PhotoGallery.Bussines.Providers;
using Epam.PhotoGallery.Bussines.Configuration;
using System.Configuration;
using System.IO;
using System.Drawing;


namespace Epam.PhotoGallery.Site.Models
{
	public class GalleryControlModel
	{
		public GalleryControlModel()
		{
			Controls = new List<TimeItem>();
		}

		/// <summary>
		/// ITimelineDataProvider provider
		/// </summary>
		private ITimelineDataProvider _provider;

		/// <summary>
		/// Gets the data provider.
		/// </summary>
		public ITimelineDataProvider _DataProvider
		{
			get
			{
				if (this._provider == null)
				{
					this._provider = new FileSystemTimelineDataProvider();
				}
				return this._provider;
			}
		}

		/// <summary>
		/// Gets or sets the controls.
		/// </summary>
		/// <value>
		/// The controls.
		/// </value>
		public IList<TimeItem> Controls { get; set; }

		/// <summary>
		/// Gets the data.
		/// </summary>
		/// <param name="path">The path.</param>
		/// <returns></returns>
		public TimeLine GetData(string path)
		{
			var result = TimeLine.GetModel(this._DataProvider, path);

			return result;
		}




	}
}